package cn.cityre.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * @author S.Z.Y
 * @created 2019-03-06 13:49
 */
public interface ManagerAiMapper {

    /**
     * 查询是否有数据存在
     * @param params 参数对象
     * @return int
     */
    int countMediaId(Map<String, Object> params);

    /**
     * 获取评论最大ID
     * @param source 产品码
     * @return cnt
     */
    @Select("SELECT count(DISTINCT mediaId) as cnt FROM `manager_ai_comment` WHERE source = #{source} and `mediaId` != ''")
    int countComment(@Param("source") String source);
}
